package org.example.enums;

/**
 * @ Author     ：hanxi
 * @ Date       ：Created in 21:20 2020/10/21
 * @ Description：开关状态标识
 */
public enum FlagStatusEnum {
    CLOSE(0,"关闭"),OPEN(1,"开启");

    private int id;

    private String desc;

    FlagStatusEnum(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public static FlagStatusEnum getEnum(int id){
        for (FlagStatusEnum flagStatusEnum:FlagStatusEnum.values()
             ) {
            if(id == flagStatusEnum.getId()){
                return flagStatusEnum;
            }
        }
        return null;
    }
    public int getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }
}
